Public Sub Synchronisation(pnbr, stat)
        '  stat = 1 to 6
        Dim match As Integer, synctotal As Integer, trace As Integer
        Dim text$
        ' master
        trace = 0
        If trace_pp = 1 Then trace = 1
        If stat Mod 2 = 0 Then
            sync0(pnbr) = stat         ' request
            match = 0
            Do
                synctotal = sync0(1) + sync0(2) + sync0(3) + sync0(4)
                Application.DoEvents()
                match = match + 1
            Loop Until synctotal = np * stat
            If trace = 1 Then
                mcnt(pnbr) = mcnt(pnbr) + match
                text$ = "Synchronisation" + Str(pnbr) + Str(sync0(1)) + Str(sync0(2)) + Str(sync0(3)) + Str(sync0(4)) + " np " + Str(np) + " total " + Str(nnout(pnbr))   
                If pnbr = 1 Then
                    DISPLAY1(indd1, text$)
                Else
                    Debug.Print(text$)
                End If
            End If
        Else
            sync1(pnbr) = stat         ' request
            match = 0
            Do
                synctotal = sync1(1) + sync1(2) + sync1(3) + sync1(4)
                Application.DoEvents()
                match = match + 1
            Loop Until synctotal = np * stat
            If trace = 1 Then
                mcnt(pnbr) = mcnt(pnbr) + match
                text$ = "Synchronisation" + Str(pnbr) + Str(sync1(1)) + Str(sync1(2)) + Str(sync1(3)) + Str(sync1(4)) + " np " + Str(np) + " total " + Str(nnout(pnbr))   
                If pnbr = 1 Then
                    DISPLAY1(indd1, text$)
                Else
                    Debug.Print(text$)
                End If
            End If
        End If
    End Sub